<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="decorator" content="default" />
<title>操作指导书管理</title>
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#zgp").select2({tags:eval('${fns:getDictValueListJson('zgp')}'),maximumSelectionSize: 1});
				$("#cz").select2({tags:eval('${fns:getDictValueListJson('cz')}')});
				$("#ysgf").select2({tags:eval('${fns:getDictValueListJson('ysgf')}'),maximumSelectionSize: 1});
				$("#yjbz").select2({tags:eval('${fns:getDictValueListJson('yjbz')}'),maximumSelectionSize: 1});
				$("#yqxh").select2({tags:eval('${fns:getDictValueListJson('yqxh')}'),maximumSelectionSize: 1});
				$("#xytj").select2({tags:eval('${fns:getDictValueListJson('xytj')}'),maximumSelectionSize: 1});
				$("#hjff").select2({tags:eval('${fns:getDictValueListJson('hjff')}'),maximumSelectionSize: 1});
				$("#jpjdj").select2({tags:eval('${fns:getDictValueListJson('jpjdj')}'),maximumSelectionSize: 1});
				$("#xzjxh").select2({tags:eval('${fns:getDictValueListJson('xzjxh')}'),maximumSelectionSize: 1});
				$("#jpgg").select2({tags:eval('${fns:getDictValueListJson('jpgg')}'),maximumSelectionSize: 1});
				$("#hgjb").select2({tags:eval('${fns:getDictValueListJson('dict_hgjb')}'),maximumSelectionSize: parseInt(eval('${fns:getDictValueListJson('dict_hgjb')}').length)});
				$("#jcbl").select2({tags:eval('${fns:getDictValueListJson('dict_jcbl')}'),maximumSelectionSize: parseInt(eval('${fns:getDictValueListJson('dict_jcbl')}').length)});
				$("#inputForm")
						.validate(
								{
									submitHandler : function(form) {
										loading('正在提交，请稍等...');
										form.submit();
									},
									errorContainer : "#messageBox",
									errorPlacement : function(error, element) {
										$("#messageBox").text("输入有误，请先更正。");
										if (element.is(":checkbox")
												|| element.is(":radio")
												|| element.parent().is(
														".input-append")) {
											error.appendTo(element.parent()
													.parent());
										} else {
											error.insertAfter(element);
										}
									}
								});
			});
</script>
</head>

<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/project/opGuide/list?projectId=${opGuide.project.id}">操作指导书列表</a></li>
		<li class="active"><a href="${ctx}/project/opGuide/form?projectId=${opGuide.project.id}&suoxie=${opGuide.project.suoxie}">操作指导书添加</a></li>
	</ul>
	<form:form id="inputForm" modelAttribute="opGuide"
		action="${ctx}/project/opGuide/save" method="post" class="form-horizontal">
		<form:hidden path="id" />
		<form:hidden path="project.id" />
		<common:message content="${message}" />
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">操作指导书编号:</label>
					<div class="controls">
						<form:input path="czzdsbh" htmlEscape="false" maxlength="50"
							class="required" readonly="true"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">工艺规程及版本号:</label>
					<div class="controls">
						<form:input path="gygcjbbh" htmlEscape="false" maxlength="50"
							class="required"  readonly="true"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">检件名称:</label>
					<div class="controls">
						<form:input path="jcmc" htmlEscape="false" maxlength="50"
							class="" />
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">检件编号:</label>
					<div class="controls">
						<form:input path="jcbh" htmlEscape="false" maxlength="50"
							class="" />
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">设备类别:</label>
					<div class="controls">
						<form:input path="sblb" htmlEscape="false" maxlength="50"
							class="required" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">材质:</label>
					<div class="controls">
						<form:input path="cz" class="input-large required" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">焊接方法:</label>
					<div class="controls">
						<form:input path="hjff" htmlEscape="false" maxlength="50"
							class="required input-large" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">坡口形式:</label>
					<div class="controls">
						<form:select path="pkxs" cssClass="input-large required">
								<form:option value="" label="请选择"/>
								<form:options items="${fns:getDictList('dict_pkxs')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>	
						<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">验收规范:</label>
					<div class="controls">
						<form:input path="ysgf" cssClass="input-large require"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">热处理状态:</label>
					<div class="controls">
						<form:select path="rclzt" cssClass="input-large  required">
							<form:option value="" label="请选择"/>
							<form:options items="${fns:getDictList('dict_rclzt')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>	
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">检测时机:</label>
					<div class="controls">
						<form:select path="jcsj" cssClass="input-large  required">
							<form:option value="" label="请选择"/>
							<form:options items="${fns:getDictList('dict_jcsj')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>	
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">依据标准:</label>
					<div class="controls">
							<form:input path="yjbz" cssClass="input-large require"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">技术等级:</label>
					<div class="controls">
						<form:select path="jsdj" cssClass="input-large  required">
							<form:option value="" label="请选择"/>
							<form:options items="${fns:getDictList('dict_jsdj')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>	
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">透照技术:</label>
					<div class="controls">
							<form:select path="tzjs" cssClass="input-large  required">
								<form:option value="" label="请选择"/>
								<form:options items="${fns:getDictList('dict_tzjs')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
							
						<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">源种类:</label>
					<div class="controls">
							<form:select path="yzl" cssClass="input-large  required">
								<form:option value="" label="请选择"/>
								<form:options items="${fns:getDictList('dict_yzl')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">仪器型号:</label>
					<div class="controls">
							<form:input path="yqxh" cssClass="input-large required"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">检测比例:</label>
					<div class="controls">
						<form:input path="jcbl" cssClass="input-large required"/>
						<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">焦点尺寸:</label>
					<div class="controls">
						<form:select path="jdcc" cssClass="input-large  required">
							<form:option value="" label="请选择"/>
							<form:options items="${fns:getDictList('dict_jdcc')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">增感屏:</label>
					<div class="controls">
						<form:input path="zgp" cssClass="input-large required"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">像质计位置:</label>
					<div class="controls">
							<form:select path="xzjwz" cssClass="input-large  required">
								<form:option value="" label="请选择"/>
								<form:options items="${fns:getDictList('dict_xzjwz')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">黑度范围:</label>
					<div class="controls">
							<form:select path="hdfw" cssClass="input-large  required">
								<form:option value="" label="请选择"/>
								<form:options items="${fns:getDictList('dict_hdfw')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">胶片及等级:</label>
					<div class="controls">
						<form:input path="jpjdj" htmlEscape="false" maxlength="50"
							class="required input-large" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">冲洗方式:</label>
					<div class="controls">
							<form:select path="cxfs" cssClass="input-large  required">
								<form:option value="" label="请选择"/>
								<form:options items="${fns:getDictList('dict_cxfs')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">显影条件:</label>
					<div class="controls">
						<form:input path="xytj" htmlEscape="false" maxlength="50"
							class="required input-large" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">规格:</label>
					<div class="controls">
						<form:input path="gg" htmlEscape="false" maxlength="50"
							class="required" onchange="onGGChange(this)"/>
							<span class="help-inline"><font color="red">* 为保证数据的一致性,系统将自动去除空格</font> </span>
					</div>
				</div>
			</div>
			<script type="text/javascript">
				function onGGChange(obj) {
					var value = obj.value;
					if(!value) {
						obj.value = 'Φ  ';
					}else {
						if(!obj.value.startsWith('Φ')) {
							obj.value = 'Φ'+obj.value;
						}
					}
					var tmp = obj.value;
					if(tmp.indexOf('Φ')>=0) {
						tmp = tmp.substr(tmp.indexOf('Φ')+1,tmp.length);
						if(tmp.indexOf('×')>=0) {
							var tmparr = tmp.split('×');
							console.log(tmparr);
							obj.value = 'Φ '+tmparr[0].trim()+'×'+tmparr[1].trim();
							var result = parseFloat(parseFloat(tmparr[0])*3.14).toFixed(1);						
							$('#hfcd').val(result);							
						}
						
					}
				}
			</script>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">透照厚度:</label>
					<div class="controls">
						<form:input path="tzh" htmlEscape="false" maxlength="50"
							class="required number" onchange="onTZHchange(this)"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
		//透照厚度 为8  管电压为160  厚度每增加2  电压增加10
		function onTZHchange(obj) {
			var tzh = $('#tzh').val();
			if(!tzh)return;
			if(obj.value) {
				obj.value = parseFloat(obj.value).toFixed(1);
				tzh = parseFloat(obj.value);
			}
			var gdy = $('#gdy');
			if(tzh==8) gdy.val(160);
			if(tzh>8) {
				gdy.val(160+10*(parseInt((tzh-8)/2)));
			}
		}
		</script>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">像质计型号:</label>
					<div class="controls">
						<form:input path="xzjxh" htmlEscape="false" maxlength="50"
							class="required input-large" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">透照方式:</label>
					<div class="controls">
						<form:select path="tzfs" cssClass="input-large  required" onchange="tzfsOnChange(this)">
							<form:option value="" label="请选择"/>
							<form:options items="${fns:getDictList('dict_tzfs')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			function tzfsOnChange(obj) {
				var val = obj.value;
				if(val && (val ==1||val==2||val==3 )) {
					$('#jj').val(700);
				}else {
					$('#jj').val('');
				}
				onJVchange();				
			}
		</script>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">焦距:</label>
					<div class="controls">
						<form:input path="jj" htmlEscape="false" maxlength="50"
							class="required digits" onchange="onJVchange()"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">工件至胶片距离:</label>
					<div class="controls">
						<form:input path="gjzjpjl" htmlEscape="false" maxlength="50"
							class="required" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">射源至工件的距离:</label>
					<div class="controls">
						<form:input path="syzgjjl" htmlEscape="false" maxlength="50"
							class="required" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">管电压:</label>
					<div class="controls">
						<form:input path="gdy" htmlEscape="false" maxlength="50"
							class="required" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>		
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">管电流/活度:</label>
					<div class="controls">
						<form:input path="gdl" htmlEscape="false" maxlength="50"
							class="required" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">曝光时间:</label>
					<div class="controls">
						<form:input path="bgsj" htmlEscape="false" maxlength="50"
							class="required" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>		
		<script type="text/javascript">
			function onJVchange() {
				//(焦距＊焦距*3)／(700*700)
				var jj = $('#jj').val();
				if(!jj)return;
				jj = parseInt(jj);
				var result = parseFloat(((jj*jj*3)/(700*700))*1.1).toFixed(1);
				$('#bgsj').val(result);
			}
		</script>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">像质计灵敏度:</label>
					<div class="controls">
						<form:input path="xzjlmd" htmlEscape="false" maxlength="50"
							class="required" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">焊缝长度:</label>
					<div class="controls">
						<form:input path="hfcd" htmlEscape="false" maxlength="50"
							class="required number" onchange="onHFCDChange(this)"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<script type="text/javascript">
				function onHFCDChange(obj) {
					if(obj.value) {
						obj.value = parseFloat(obj.value).toFixed(1);
					}
				}
			</script>
		</div>		
		<script type="text/javascript">
		</script>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">一次透照长度:</label>
					<div class="controls">
						<form:input path="yctzcd" htmlEscape="false" maxlength="50"
							class="required number" onchange="onYctzcdChange(this)"/>
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<script type="text/javascript">
				function onYctzcdChange(obj) {
					obj.value = parseFloat(obj.value).toFixed(1);					
				}
			</script>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">透照张数:</label>
					<div class="controls">
						<form:input path="tzcs" htmlEscape="false" maxlength="50"
							class="required digits" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span6">
				<div class="control-group">
					<label class="control-label">合格级别:</label>
					<div class="controls">
						<form:input path="hgjb" htmlEscape="false" maxlength="50"
									class="required input-large" />
							<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
			<div class="span6">
				<div class="control-group">
					<label class="control-label">胶片规格:</label>
					<div class="controls">
						<form:input path="jpgg" htmlEscape="false" cssClass="input-large required" />
						<span class="help-inline"><font color="red">*</font> </span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="span12">
				<div class="control-group">
					<label class="control-label">备注:</label>
					<div class="controls">
						<form:input path="remarks" htmlEscape="false"  class="input-xlarge" />
					</div>
				</div>
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit"
				value="保 存" />&nbsp; 
				<input id="btnCancel" class="btn" type="button"
				value="返 回" onclick="history.go(-1)" />
		</div>
	</form:form>
</body>
</html>